<?php

	class WS_PersonalInformationCon {
		
		private $DBADMIN;
		private $HASHID;
		
		public function __construct() {

			$this->DBMOD 	= new WS_PersonalInformationMod();
			$this->HASHID 	= sha1(time());

		}
		
		### PERSONAL INFORMATION INSERT EDIT DELETE
			# New Account
			public function insertPersonalInformation($strArray) {
				
				return $this->DBMOD->insertPersonalInformation($strArray);
				
			}
			# Update Personal Record - Header
			public function updatePersonalInformation($strArray, $strID) {
				
				$this->DBMOD->updatePersonalInformation($strArray, $strID);
				
			}
			# Delete Accound
			public function deletePersonalInformation($strID) {
				
				$this->DBMOD->deletePersonalInformation($strID);
				
			}
			
		### STUDENT INFORMATION INSERT EDIT DELETE
			# Update Personal Record - Header
			public function updateStudentPersonalInformation($strArray, $strID) {
				
				$this->DBMOD->updateStudentPersonalInformation($strArray, $strID);
				
			}
			
		###
		
		public function accountNumber($strID) {
			
			$return = $this->DBMOD->accountNumber($strID);
			
			return $return['count'];
			
		}
		
		public function accountUserPass($strUser, $strPass) {
			
			$return = $this->DBMOD->accountUserPass($strUser, $strPass);
			
			return $return['count'];
			
		}
		
		# Individual Record - Global
		public function getPersonalInformation($strID) {
			
			return $this->DBMOD->getPersonalInformation($strID);
			
		}
		
		# Individual Record - Global - STUDENT
		public function getStudentPersonalInformation($strID) {
			
			return $this->DBMOD->getStudentPersonalInformation($strID);
			
		}
		
		# List of Accounts
		public function listCountPersonalInformation($strSearch = '', $strAccountType =  "'A', 'D', 'R', 'P'", $strDepartment = '') {
			
			$return = $this->listPersonalInformation($strSearch, '', $strAccountType, $strDepartment);
			
			return count($return);
			
		}
		# List of Accounts
		public function listPersonalInformation($strSearch = 'Search here...', $pageLimit = '', $strAccountType =  "'A', 'D', 'R', 'P'", $strDepartment = '') {
			
			if ( $strSearch == 'Search here...' ) {
				$strSearch = '';
			}
			
			return $this->DBMOD->listPersonalInformation($strSearch, $pageLimit, $strAccountType, $strDepartment);
			
		}
		# Get Old Password
		public function getOldPassword($strPass) {
			
			$return = $this->DBMOD->getOldPassword($strPass);
			
			return $return['count_record'];
			
		}
		
		# Get Old Password
		public function getStudentOldPassword($strPass) {
			
			$return = $this->DBMOD->getStudentOldPassword($strPass);
			
			return $return['count_record'];
			
		}
		
		# Update Username and Password
		public function updatePassword($strArray, $strID) {
			
			$this->DBMOD->updatePassword($strArray, $strID);
			
		}
		
		# Update Username and Password
		public function updateStudentPassword($strArray, $strID) {
			
			$this->DBMOD->updateStudentPassword($strArray, $strID);
			
		}
		
		# Get Username
		public function getUsername($strID) {
			
			$return = $this->DBMOD->getUsername($strID);
			
			return $return['log_user'];
			
		}
		
		# Get Username
		public function getStudentUsername($strID) {
			
			$return = $this->DBMOD->getStudentUsername($strID);
			
			return $return['log_user'];
			
		}
		# Get Picture
		public function getPicture($strID) {
			
			$return = $this->DBMOD->getPicture($strID);
			
			return $return['picture'];
			
		}
		
		public function getStudentPicture($strID) {
			
			$return = $this->DBMOD->getStudentPicture($strID);
			
			return $return['picture'];
			
		}
		
		# Change Picture
		public function changePicture($strFile, $strID) {
			
			$this->DBMOD->changePicture($strFile, $strID);
			
		}
		
		# Change Picture
		public function changeStudentPicture($strFile, $strID) {
			
			$this->DBMOD->changeStudentPicture($strFile, $strID);
			
		}
		
		
	}
?>